package database;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;

public class testtime {

    public Connect c = new Connect();
    private Statement stmt = null;
    private ResultSet rs = null;

    public testtime() {

    }

    public void getnow() {

        c.DConnect();
        try {
            stmt = c.nect.createStatement();
            rs = stmt.executeQuery("select now()");
            while (rs.next()) {
                Date d = rs.getDate(1);
                System.out.println(d.toString());
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if(rs != null){
            try {
                rs.close();
            } catch (SQLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        if(stmt != null){
            try {
                stmt.close();
            } catch (SQLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

    }




}
